package refactor.replacetypecodewithstateorstrategy;

public abstract class EmployeeType {
    public static final int ENGINEER = 1;
    public static final int SALESMAN = 2;
    public static final int MANAGER = 3;

    public abstract int getType();

    public static EmployeeType createEmployeeType(int type) {
        if (type == ENGINEER) {
            return new Engineer();
        }
        if (type == SALESMAN) {
            return new Salesman();
        }
        if (type == MANAGER) {
            return new Manager();
        }
        return null;
    }
}
